home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / util / arc / xadmaster.lha / xad / Developer / Include / ASM / libraries / xadmaster.i
Encoding:
Text File  |  2000-08-31  |  23.9 KB  |  604 lines

  1.     IFND    LIBRARIES_XADMASTER_I
  2. LIBRARIES_XADMASTER_I    SET    1
  3.  
  4. *
  5. *    $VER: xadmaster.i 8.0 (20.08.2000)
  6. *    xadmaster.library defines and structures
  7. *
  8. *    Copyright © 1998-2000 by Dirk Stöcker
  9. *    All Rights Reserved.
  10. *
  11.  
  12.     IFND    EXEC_LIBRARIES_I
  13.     INCLUDE    "exec/libraries.i"
  14.     ENDC
  15.  
  16.     IFND    UTILITY_TAGITEM_I
  17.     INCLUDE    "utility/tagitem.i"
  18.     ENDC
  19.  
  20. XADNAME    MACRO
  21.     DC.B  'xadmaster.library',0
  22.     ENDM
  23.  
  24. * NOTE: The structures do not have size labels, as they have no fixed
  25. * size. You always need to call xadAllocObject to get them
  26.  
  27. *************************************************************************
  28. *                                                *
  29. *    library base structure                        *
  30. *                                                *
  31. *************************************************************************
  32.  
  33.     STRUCTURE xadMasterBase,LIB_SIZE
  34.     APTR    xmb_SysBase
  35.     APTR    xmb_DOSBase
  36.     APTR    xmb_UtilityBase
  37.     ULONG    xmb_RecogSize        * read only
  38.       APTR    xmb_DefaultName        * name for XADFIF_NOFILENAME (V6)
  39.  
  40. *************************************************************************
  41. *                                                *
  42. *    tag-function call flags                               *
  43. *                                                *
  44. *************************************************************************
  45.  
  46. * input tags for xadGetInfo, only one can be specified per call
  47. XAD_INSIZE        EQU    (TAG_USER+001) * input data size
  48. XAD_INFILENAME        EQU    (TAG_USER+002)
  49. XAD_INFILEHANDLE    EQU    (TAG_USER+003)
  50. XAD_INMEMORY        EQU    (TAG_USER+004)
  51. XAD_INHOOK        EQU    (TAG_USER+005)
  52. XAD_INSPLITTED        EQU    (TAG_USER+006) * (V2)
  53. XAD_INDISKARCHIVE    EQU    (TAG_USER+007) * (V4)
  54. XAD_INXADSTREAM        EQU    (TAG_USER+008) * (V8)
  55.  
  56. * output tags, only one can be specified per call, xadXXXXUnArc
  57. XAD_OUTSIZE        EQU    (TAG_USER+010) * output data size
  58. XAD_OUTFILENAME        EQU    (TAG_USER+011)
  59. XAD_OUTFILEHANDLE    EQU    (TAG_USER+012)
  60. XAD_OUTMEMORY        EQU    (TAG_USER+013)
  61. XAD_OUTHOOK        EQU    (TAG_USER+014)
  62. XAD_OUTDEVICE        EQU    (TAG_USER+015) * for disk archives only
  63. XAD_OUTXADSTREAM    EQU    (TAG_USER+016) * (V8)
  64.  
  65. * object allocation tags for xadAllocObjectA
  66. XAD_OBJNAMESIZE        EQU    (TAG_USER+020) * XADOBJ_FILEINFO, size of needed name space
  67. XAD_OBJCOMMENTSIZE    EQU    (TAG_USER+021) * XADOBJ_FILEINFO, size of needed comment space
  68. XAD_OBJPRIVINFOSIZE    EQU    (TAG_USER+022) * XADOBJ_FILEINFO & XADOBJ_DISKINFO, self use size
  69. XAD_OBJBLOCKENTRIES    EQU    (TAG_USER+023) * XADOBJ_DISKINFO, number of needed entries
  70.  
  71. * tags for xadGetInfo, xadFileUnArc and xadDiskUnArc
  72. XAD_NOEXTERN        EQU    (TAG_USER+050) * do not use extern clients
  73. XAD_PASSWORD        EQU    (TAG_USER+051) * password when needed
  74. XAD_ENTRYNUMBER        EQU    (TAG_USER+052) * number of wanted entry
  75. XAD_PROGRESSHOOK    EQU    (TAG_USER+053) * the progress hook
  76. XAD_OVERWRITE        EQU    (TAG_USER+054) * overwrite file ?
  77. XAD_MAKEDIRECTORY    EQU    (TAG_USER+055) * create directory tree
  78. XAD_IGNOREGEOMETRY    EQU    (TAG_USER+056) * ignore drive geometry ?
  79. XAD_LOWCYLINDER        EQU    (TAG_USER+057) * lowest cylinder
  80. XAD_HIGHCYLINDER    EQU    (TAG_USER+058) * highest cylinder
  81. XAD_VERIFY        EQU    (TAG_USER+059) * verify for disk hook
  82. XAD_NOKILLPARTIAL    EQU    (TAG_USER+060) * do not delete partial/corrupt files (V3.3)
  83. XAD_FORMAT        EQU    (TAG_USER+061) * format output device (V5)
  84.  
  85. * input tags for xadConvertDates, only one can be passed
  86. XAD_DATEUNIX        EQU    (TAG_USER+070) * unix date variable
  87. XAD_DATEAMIGA        EQU    (TAG_USER+071) * amiga date variable
  88. XAD_DATEDATESTAMP    EQU    (TAG_USER+072) * struct DateStamp
  89. XAD_DATEXADDATE        EQU    (TAG_USER+073) * struct xadDate
  90. XAD_DATECLOCKDATA    EQU    (TAG_USER+074) * struct ClockData
  91. XAD_DATECURRENTTIME    EQU    (TAG_USER+075) * input is system time
  92. XAD_DATEMSDOS        EQU    (TAG_USER+076) * MS-DOS packed format (V2)
  93. XAD_DATEMAC        EQU    (TAG_USER+077) * Mac date variable (V8)
  94.  
  95. * output tags, there can be specified multiple tags for one call
  96. XAD_GETDATEUNIX     EQU    (TAG_USER+080) * unix date variable
  97. XAD_GETDATEAMIGA    EQU    (TAG_USER+081) * amiga date variable
  98. XAD_GETDATEDATESTAMP    EQU    (TAG_USER+082) * struct DateStamp
  99. XAD_GETDATEXADDATE    EQU    (TAG_USER+083) * struct xadDate
  100. XAD_GETDATECLOCKDATA    EQU    (TAG_USER+084) * struct ClockData
  101. XAD_GETDATEMSDOS    EQU    (TAG_USER+086) * MS-DOS packed format (V2)
  102. XAD_GETDATEMAC        EQU    (TAG_USER+087) * Mac date variable (V8)
  103.  
  104. * following tags need locale.library to be installed
  105. XAD_MAKEGMTDATE        EQU    (TAG_USER+090) * make local to GMT time
  106. XAD_MAKELOCALDATE    EQU    (TAG_USER+091) * make GMT to local time
  107.  
  108. * tags for xadHookTagAccess (V3)
  109. XAD_USESKIPINFO        EQU    (TAG_USER+104) * the hook uses xadSkipInfo (V3)
  110.  
  111. XAD_GETCRC16        EQU    (TAG_USER+120) * pointer to UWORD value (V3)
  112. XAD_GETCRC32        EQU    (TAG_USER+121) * pointer to ULONG value (V3)
  113.  
  114. XAD_CRC16ID        EQU    (TAG_USER+130) * ID for crc calculation (V3)
  115. XAD_CRC32ID        EQU    (TAG_USER+131) * ID for crc calculation (V3)
  116.  
  117. * tags for xadConvertProtection (V4)
  118. XAD_PROTAMIGA        EQU    (TAG_USER+160) * Amiga type protection bits (V4)
  119. XAD_PROTUNIX        EQU    (TAG_USER+161) * protection bits in UNIX mode (V4)
  120. XAD_PROTMSDOS        EQU    (TAG_USER+162) * MSDOS type protection bits (V4)
  121.  
  122. XAD_GETPROTAMIGA    EQU    (TAG_USER+170) * return Amiga protection bits (V4)
  123.  
  124. * tags for xadGetDiskInfo (V7)
  125. XAD_STARTCLIENT        EQU    (TAG_USER+180) * the client to start with (V7)
  126. XAD_NOEMPTYERROR    EQU    (TAG_USER+181) * do not create XADERR_EMPTY (V8)
  127.  
  128. * tags for xadFreeHookAccess (V8)
  129. XAD_WASERROR        EQU    (TAG_USER+190) * error occured, call abort method (V8)
  130.  
  131. * tags for miscellaneous stuff
  132. XAD_ARCHIVEINFO        EQU    (TAG_USER+200) * xadArchiveInfo for stream hooks (V8)
  133.  
  134. *************************************************************************
  135. *                                                *
  136. *    objects for xadAllocObjectA                           *
  137. *                                                *
  138. *************************************************************************
  139.  
  140. XADOBJ_ARCHIVEINFO    EQU    $0001 * struct xadArchiveInfo
  141. XADOBJ_FILEINFO        EQU    $0002 * struct xadFileInfo
  142. XADOBJ_DISKINFO        EQU    $0003 * struct xadDiskInfo
  143. XADOBJ_HOOKPARAM    EQU    $0004 * struct HookParam
  144. XADOBJ_DEVICEINFO    EQU    $0005 * struct xadDeviceInfo
  145. XADOBJ_PROGRESSINFO    EQU    $0006 * struct xadProgressInfo
  146. XADOBJ_TEXTINFO        EQU    $0007 * struct xadTextInfo
  147. XADOBJ_SPLITFILE    EQU    $0008 * struct xadSplitFile (V2)
  148. XADOBJ_SKIPINFO        EQU    $0009 * struct xadSkipInfo (V3)
  149. XADOBJ_IMAGEINFO    EQU    $000A * struct xadImageInfo (V4)
  150.  
  151. * result type of xadAllocVec
  152. XADOBJ_MEMBLOCK        EQU    $0100 * memory of requested size and type
  153.  
  154. *************************************************************************
  155. *                                                *
  156. *    modes for xadCalcCRC126 and xadCalcCRC32                *
  157. *                                                *
  158. *************************************************************************
  159.  
  160. XADCRC16_ID1        EQU    $A001
  161. XADCRC32_ID1        EQU    $EDB88320
  162.  
  163. *************************************************************************
  164. *                                                *
  165. *    hook related stuff                                *
  166. *                                                *
  167. *************************************************************************
  168.  
  169. XADHC_READ    EQU    1    * read data into buffer
  170. XADHC_WRITE    EQU    2    * write buffer data to file/memory
  171. XADHC_SEEK    EQU    3    * seek in file
  172. XADHC_INIT    EQU    4    * initialize the hook
  173. XADHC_FREE    EQU    5    * end up hook work, free stuff
  174. XADHC_ABORT    EQU    6    * an error occured, delete partial stuff
  175. XADHC_FULLSIZE    EQU    7    * complete input size is needed
  176. XADHC_IMAGEINFO    EQU    8    * return disk image info (V4)
  177.  
  178.     STRUCTURE xadHookParam,0
  179.       ULONG    xhp_Command
  180.     ULONG    xhp_CommandData
  181.     APTR    xhp_BufferPtr
  182.       LONG    xhp_BufferSize
  183.       LONG    xhp_DataPos    * current seek position
  184.       APTR    xhp_PrivatePtr
  185.  
  186. * xadHookAccess commands
  187. XADAC_READ        EQU    10    * get data
  188. XADAC_WRITE        EQU    11    * write data
  189. XADAC_COPY        EQU    12    * copy input to output
  190. XADAC_INPUTSEEK        EQU    13    * seek in input file
  191. XADAC_OUTPUTSEEK    EQU    14    * seek in output file
  192.  
  193. *************************************************************************
  194. *                                                *
  195. *    support structures                              *
  196. *                                                *
  197. *************************************************************************
  198.  
  199. * Own date structure to cover all possible dates in a human friendly
  200. * format. xadConvertDates may be used to convert between different date
  201. * structures and variables.
  202.     STRUCTURE xadDate,0
  203.       ULONG     xd_Micros    * values 0 to 999999
  204.       LONG      xd_Year         * values 1 to 2147483648
  205.       UBYTE     xd_Month    * values 1 to 12
  206.       UBYTE     xd_WeekDay    * values 1 to 7
  207.       UBYTE     xd_Day        * values 1 to 31
  208.       UBYTE     xd_Hour        * values 0 to 23
  209.       UBYTE     xd_Minute    * values 0 to 59
  210.       UBYTE     xd_Second    * values 0 to 59
  211.       LABEL     xadDate_SIZE
  212.  
  213. XADDAY_MONDAY        EQU    1    * monday is the first day and
  214. XADDAY_TUESDAY        EQU    2
  215. XADDAY_WEDNESDAY    EQU    3
  216. XADDAY_THURSDAY        EQU    4
  217. XADDAY_FRIDAY        EQU    5
  218. XADDAY_SATURDAY     EQU    6
  219. XADDAY_SUNDAY        EQU    7    * sunday the last day of a week
  220.  
  221.     STRUCTURE xadDeviceInfo,0    * for XAD_OUTDEVICE tag
  222.     APTR    xdi_DeviceName    * name of device
  223.     ULONG    xdi_Unit    * unit of device
  224.     APTR    xdi_DOSName    * instead of Device+Unit, dos name without ':'
  225.  
  226.     STRUCTURE xadSplitFile,0    * for XAD_INSPLITTED
  227.       APTR    xsf_Next
  228.     ULONG    xsf_Type    * XAD_INFILENAME, XAD_INFILEHANDLE, XAD_INMEMORY, XAD_INHOOK
  229.     ULONG    xsf_Size    * necessary for XAD_INMEMORY, useful for others
  230.     ULONG    xsf_Data    * FileName, Filehandle, Hookpointer or Memory
  231.  
  232.     STRUCTURE xadSkipInfo,0
  233.     APTR    xsi_Next
  234.     ULONG    xsi_Position    * position, where it should be skipped
  235.     ULONG    xsi_SkipSize    * size to skip
  236.  
  237.     STRUCTURE xadImageInfo,0    * for XADHC_IMAGEINFO
  238.     ULONG xii_SectorSize    * usually 512
  239.     ULONG xii_FirstSector    * of the image file
  240.     ULONG xii_NumSectors    * of the image file
  241.     ULONG xii_TotalSectors    * of this device type
  242.     * If the image file holds total data of disk xii_TotalSectors equals
  243.        * xii_NumSectors and xii_FirstSector is zero. Addition of xii_FirstSector
  244.     * and xii_NumSectors cannot exceed xii_TotalSectors value!
  245.  
  246. *************************************************************************
  247. *                                                *
  248. *    information structures                              *
  249. *                                                *
  250. *************************************************************************
  251.  
  252.     STRUCTURE xadArchiveInfo,0
  253.       APTR    xai_Client      * pointer to unarchiving client
  254.     APTR    xai_PrivateClient * private client data
  255.     APTR    xai_Password      * password for crypted archives
  256.     ULONG    xai_Flags        * read only XADAIF_ flags
  257.     ULONG    xai_LowCyl       * lowest cylinder to unarchive
  258.     ULONG    xai_HighCyl      * highest cylinder to unarchive
  259.     ULONG    xai_InPos        * input position, read only
  260.     ULONG    xai_InSize       * input size, read only
  261.     ULONG    xai_OutPos       * output position, read only
  262.     ULONG    xai_OutSize      * output file size, read only
  263.     APTR    xai_FileInfo      * data pointer for file arcs
  264.     APTR    xai_DiskInfo      * data pointer for disk arcs
  265.     APTR    xai_CurFile      * data pointer for current file arc
  266.     APTR    xai_CurDisk      * data pointer for current disk arc
  267.       LONG    xai_LastError      * last error, when XADAIF_FILECORRUPT (V2)
  268.     APTR    xai_MultiVolume      * array of start offsets from parts (V2)
  269.     APTR    xai_SkipInfo      * linked list of skip entries (V3)
  270.       APTR    xai_ImageInfo      * for filesystem clients (V5)
  271.     APTR    xai_InName      * Input archive name if available (V7)
  272.  
  273. * This structure is nearly complete private to either xadmaster or its
  274. * clients. An application program may access for reading only xai_Client,
  275. * xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
  276. * is useful. All the other stuff is private and should not be accessed!
  277.  
  278.     BITDEF XADAI,CRYPTED,0        * archive entries are encrypted
  279.     BITDEF XADAI,FILECORRUPT,1    * file is corrupt, but valid entries are in the list
  280.     BITDEF XADAI,FILEARCHIVE,2    * unarchive file entry
  281.     BITDEF XADAI,DISKARCHIVE,3    * unarchive disk entry
  282.     BITDEF XADAI,OVERWRITE,4    * overwrite the file (PRIVATE)
  283.     BITDEF XADAI,MAKEDIRECTORY,5    * create directory when missing (PRIVATE)
  284.     BITDEF XADAI,IGNOREGEOMETRY,6    * ignore drive geometry (PRIVATE)
  285.     BITDEF XADAI,VERIFY,7        * verify is turned on for disk hook (PRIVATE)
  286.     BITDEF XADAI,NOKILLPARTIAL,8    * do not delete partial files (PRIVATE)
  287.     BITDEF XADAI,DISKIMAGE,9    * is disk image extraction (V5)
  288.     BITDEF XADAI,FORMAT,10        * format in disk hook (PRIVATE)
  289.     BITDEF XADAI,NOEMPTYERROR,11    * do not create empty error (PRIVATE)
  290.     BITDEF XADAI,ONLYIN,12        * in stuff only (PRIVATE)
  291.     BITDEF XADAI,ONLYOUT,13        * out stuff only (PRIVATE)
  292.  
  293.     STRUCTURE xadFileInfo,0
  294.     APTR    xfi_Next
  295.     ULONG    xfi_EntryNumber    * number of entry, starts with 1
  296.     APTR    xfi_EntryInfo      * additional archiver text
  297.     APTR    xfi_PrivateInfo    * client private, see XAD_OBJPRIVINFOSIZE
  298.     ULONG    xfi_Flags          * see XADFIF_xxx defines
  299.     APTR    xfi_FileName       * see XAD_OBJNAMESIZE tag
  300.     APTR    xfi_Comment        * see XAD_OBJCOMMENTSIZE tag
  301.     ULONG      xfi_Protection     * OS 3 bits (including multiuser)
  302.     ULONG    xfi_OwnerUID       * user ID
  303.     ULONG    xfi_OwnerGID       * group ID
  304.     APTR    xfi_UserName       * user name
  305.     APTR    xfi_GroupName      * group name
  306.     ULONG   xfi_Size           * size of this file
  307.     ULONG    xfi_GroupCrSize    * crunched size of group
  308.     ULONG    xfi_CrunchSize     * crunched size
  309.     APTR    xfi_LinkName       * name and path of link
  310.     STRUCT    xfi_Date,xadDate_SIZE
  311.     UWORD   xfi_Generation  * File Generation [0...$FFFF] (V3)
  312.     ULONG    xfi_DataPos     * crunched data position (V3)
  313.     APTR    xfi_MacFork     * pointer to 2nd fork for Mac (V7)
  314.  
  315. * Multiuser fields (xfi_OwnerUID, xfi_OwnerUID, xfi_UserName, xfi_GroupName)
  316. * and multiuser bits (see <dos/dos.h>) are currently not supported with normal
  317. * Amiga filesystem. But the clients support them, if archive format holds
  318. * such information.
  319.  
  320.     BITDEF XADFI,CRYPTED,0        * entry is crypted
  321.     BITDEF XADFI,DIRECTORY,1    * entry is a directory
  322.     BITDEF XADFI,LINK,2        * entry is a link
  323.     BITDEF XADFI,INFOTEXT,3        * file is an information text
  324.     BITDEF XADFI,GROUPED,4        * file is in a crunch group
  325.     BITDEF XADFI,ENDOFGROUP,5    * crunch group ends here
  326.     BITDEF XADFI,NODATE,6        * no date supported, CURRENT date is set
  327.     BITDEF XADFI,DELETED,7        * file is marked as deleted (V3)
  328.     BITDEF XADFI,SEEKDATAPOS,8    * before unarchiving the datapos is set (V3)
  329.     BITDEF XADFI,NOFILENAME,9    * there was no filename, using internal one (V6)
  330.     BITDEF XADFI,NOUNCRUNCHSIZE,10    * file size is unknown and thus set to zero (V6)
  331.     BITDEF XADFI,PARTIALFILE,11    * file is only partial (V6)
  332.     BITDEF XADFI,MACDATA,12        * file is Apple data fork (V7)
  333.     BITDEF XADFI,MACRESOURCE,13    * file is Apple resource fork (V7)
  334.  
  335. * NOTE: the texts passed with that structure must not always be printable.
  336. * Although the clients should add an additional (not counted) zero at the text
  337. * end, the whole file may contain other unprintable stuff (e.g. for DMS).
  338. * So when printing this texts do it on a byte for byte base including
  339. * printability checks.
  340.  
  341.     STRUCT xadTextInfo,0
  342.     APTR    xti_Next
  343.     ULONG    xti_Size    * maybe zero - no text - e.g. when crypted
  344.     APTR    xti_Text    * and there is no password in xadGetInfo()
  345.     ULONG    xti_Flags    * see XADTIF_xxx defines
  346.  
  347.     BITDEF    XADTI,CRYPTED,0    * entry is empty, as data was crypted
  348.     BITDEF    XADTI,BANNER,1    * text is a banner
  349.     BITDEF    XADTI,FILEDIZ,2    * text is a file description
  350.  
  351.     STRUCT xadDiskInfo,0
  352.     APTR    xdi_Next
  353.     ULONG    xdi_EntryNumber      * number of entry, starts with 1
  354.     APTR    xdi_EntryInfo        * additional archiver text
  355.     APTR    xdi_PrivateInfo      * client private, see XAD_OBJPRIVINFOSIZE
  356.     ULONG    xdi_Flags         * see XADDIF_xxx defines
  357.     ULONG    xdi_SectorSize
  358.     ULONG    xdi_TotalSectors    * see devices/trackdisk.h
  359.     ULONG    xdi_Cylinders        * to find out what these
  360.     ULONG    xdi_CylSectors          * fields mean, they are equal
  361.     ULONG    xdi_Heads          * to struct DriveGeometry
  362.     ULONG    xdi_TrackSectors
  363.     ULONG    xdi_LowCyl           * lowest cylinder stored
  364.     ULONG    xdi_HighCyl          * highest cylinder stored
  365.     ULONG    xdi_BlockInfoSize    * number of BlockInfo entries
  366.     APTR    xdi_BlockInfo        * see XADBIF_xxx defines and XAD_OBJBLOCKENTRIES tag
  367.     APTR    xdi_TextInfo        * linked list with info texts
  368.     ULONG    xdi_DataPos        * crunched data position (V3)
  369.  
  370. * BlockInfo points to a UBYTE field for every track from first sector of
  371. * lowest cylinder to last sector of highest cylinder. When not used,
  372. * pointer must be 0. Do not use it, when there are no entries!
  373. * This is just for information. The applications still asks the client
  374. * to unarchive whole cylinders and not archived blocks are cleared for
  375. * unarchiving.
  376.     BITDEF XADDI,CRYPTED,0        * entry is crypted
  377.     BITDEF XADDI,SEEKDATAPOS,1    * before unarchiving the datapos is set (V3)
  378.  
  379. * Some of the crunchers do not store all necessary information, so it
  380. * may be needed to guess some of them. Set the following flags in that case
  381. * and geometry check will ignore these fields.
  382.     BITDEF XADDI,GUESSCYLINDERS,7      * cylinder number is guessed
  383.     BITDEF XADDI,GUESSCYLSECTORS,8      * cylsectors is guessed
  384.     BITDEF XADDI,GUESSHEADS,9      * number of heads is guessed
  385.     BITDEF XADDI,GUESSTRACKSECTORS,10 * tracksectors is guessed
  386.     BITDEF XADDI,GUESSLOWCYL,11      * lowcyl is guessed
  387.     BITDEF XADDI,GUESSHIGHCYL,12      * highcyl is guessed
  388.  
  389. * If it is impossible to set some of the fields, you need to set some of
  390. * these flags. NOTE: XADDIB_NOCYLINDERS is really important, as this turns
  391. * of usage of lowcyl and highcyl keywords. When you have cylinder information,
  392. * you should not use these and instead use guess flags and calculate
  393. * possible values for the missing fields.
  394.     BITDEF XADDI,NOCYLINDERS,15    * cylinder number is not set
  395.     BITDEF XADDI,NOCYLSECTORS,16    * cylsectors is not set
  396.     BITDEF XADDI,NOHEADS,17        * number of heads is not set
  397.     BITDEF XADDI,NOTRACKSECTORS,18    * tracksectors is not set
  398.     BITDEF XADDI,NOLOWCYL,19    * lowcyl is not set
  399.     BITDEF XADDI,NOHIGHCYL,20    * highcyl is not set
  400.  
  401. * defines for BlockInfo
  402.     BITDEF XADBI,CLEARED,0    * this block was cleared for archiving
  403.     BITDEF XADBI,UNUSED,1    * this block was not archived
  404.  
  405. *************************************************************************
  406. *                                                *
  407. *    progress report stuff                              *
  408. *                                                *
  409. *************************************************************************
  410.  
  411.     STRUCTURE xadProgressInfo,0
  412.     ULONG    xpi_Mode    * work modus
  413.     APTR    xpi_Client    * the client doing the work
  414.     APTR    xpi_DiskInfo    * current diskinfo, for disks
  415.     APTR    xpi_FileInfo    * current info for files
  416.     ULONG    xpi_CurrentSize    * current filesize
  417.     ULONG    xpi_LowCyl    * for disks only
  418.     ULONG    xpi_HighCyl    * for disks only
  419.     ULONG    xpi_Status    * see XADPIF flags
  420.     LONG    xpi_Error    * any of the error codes
  421.     APTR    xpi_FileName    * name of file to overwrite (V2)
  422.     APTR    xpi_NewName    * new name buffer, passed by hook (V2)
  423. * NOTE: For disks CurrentSize is Sector*SectorSize, where SectorSize can
  424. * be found in xadDiskInfo structure. So you may output the sector value.
  425.  
  426. * different progress modes
  427. XADPMODE_ASK        EQU    1
  428. XADPMODE_PROGRESS    EQU    2
  429. XADPMODE_END        EQU    3
  430. XADPMODE_ERROR        EQU    4
  431.  
  432. * flags for progress hook and ProgressInfo status field
  433.     BITDEF XADPI,OVERWRITE,0    * overwrite the file
  434.     BITDEF XADPI,MAKEDIRECTORY,1    * create the directory
  435.     BITDEF XADPI,IGNOREGEOMETRY,2    * ignore drive geometry
  436.     BITDEF XADPI,RENAME,10        * rename the file (V2)
  437.     BITDEF XADPI,OK,16        * all ok, proceed
  438.     BITDEF XADPI,SKIP,17        * skip file
  439.  
  440. *************************************************************************
  441. *                                                *
  442. *    errors                                       *
  443. *                                                *
  444. *************************************************************************
  445.  
  446. XADERR_OK        EQU    $0000 * no error
  447. XADERR_UNKNOWN        EQU    $0001 * unknown error
  448. XADERR_INPUT        EQU    $0002 * input data buffers border exceeded
  449. XADERR_OUTPUT        EQU    $0003 * output data buffers border exceeded
  450. XADERR_BADPARAMS    EQU    $0004 * function called with illegal parameters
  451. XADERR_NOMEMORY        EQU    $0005 * not enough memory available
  452. XADERR_ILLEGALDATA    EQU    $0006 * data is corrupted
  453. XADERR_NOTSUPPORTED    EQU    $0007 * command is not supported
  454. XADERR_RESOURCE        EQU    $0008 * required resource missing
  455. XADERR_DECRUNCH        EQU    $0009 * error on decrunching
  456. XADERR_FILETYPE        EQU    $000A * unknown file type
  457. XADERR_OPENFILE        EQU    $000B * opening file failed
  458. XADERR_SKIP        EQU    $000C * file, disk has been skipped
  459. XADERR_BREAK        EQU    $000D * user break in progress hook
  460. XADERR_FILEEXISTS    EQU    $000E * file already exists
  461. XADERR_PASSWORD        EQU    $000F * missing or wrong password
  462. XADERR_MAKEDIR        EQU    $0010 * could not create directory
  463. XADERR_CHECKSUM        EQU    $0011 * wrong checksum
  464. XADERR_VERIFY        EQU    $0012 * verify failed (disk hook)
  465. XADERR_GEOMETRY        EQU    $0013 * wrong drive geometry
  466. XADERR_DATAFORMAT    EQU    $0014 * unknown data format
  467. XADERR_EMPTY        EQU    $0015 * source file contains no files
  468. XADERR_FILESYSTEM    EQU    $0016 * unknown filesystem
  469.  
  470. *************************************************************************
  471. *                                                *
  472. *    client related stuff                           *
  473. *                                                *
  474. *************************************************************************
  475.  
  476.     STRUCTURE xadForeman,0
  477.     ULONG    xfm_Security    * should be XADFOREMAN_SECURITY
  478.     ULONG    xfm_ID              * must be XADFOREMAN_ID
  479.     UWORD    xfm_Version     * set to XADFOREMAN_VERSION
  480.     UWORD    xfm_Reserved
  481.     APTR    xfm_VersString  * pointer to $VER: string
  482.     APTR    xfm_FirstClient * pointer to first client
  483.     LABEL    xadForman_SIZE
  484.  
  485. XADFOREMAN_SECURITY    EQU    $70FF4E75 * MOVEQ #-1,D0 and RTS
  486. XADFOREMAN_ID        EQU    $58414446 * 'XADF' identification ID
  487. XADFOREMAN_VERSION    EQU    1
  488.  
  489.     STRUCTURE xadClient,0
  490.     APTR    xc_Next
  491.     UWORD    xc_Version    * set to XADCLIENT_VERSION
  492.     UWORD    xc_MasterVersion
  493.     UWORD    xc_ClientVersion
  494.     UWORD    xc_ClientRevision
  495.     ULONG    xc_RecogSize    * needed size to recog the type
  496.     ULONG    xc_Flags    * see XADCF_xxx defines
  497.     ULONG    xc_Identifier    * ID of internal clients
  498.     APTR    xc_ArchiverName
  499.     APTR    xc_RecogData
  500.     APTR    xc_GetInfo
  501.     APTR    xc_UnArchive
  502.     APTR    xc_Free
  503.     LABEL    xadClient_SIZE
  504.  
  505. * function interface
  506. * ASM(BOOL) xc_RecogData(REG(d0, ULONG size), REG(a0, STRPTR data),
  507. *        REG(a6, struct xadMasterBase *xadMasterBase))
  508. * ASM(LONG) xc_GetInfo(REG(a0, struct xadArchiveInfo *ai),
  509. *        REG(a6, struct xadMasterBase *xadMasterBase))
  510. * ASM(LONG) xc_UnArchive(REG(a0, struct xadArchiveInfo *ai),
  511. *        REG(a6, struct xadMasterBase *xadMasterBase))
  512. * ASM(void) xc_Free(REG(a0, struct xadArchiveInfo *ai),
  513. *        REG(a6, struct xadMasterBase *xadMasterBase))
  514.  
  515.  
  516. * xc_RecogData returns 1 when recognized and 0 when not, all the others
  517. * return 0 when ok and XADERR values on error. xc_Free has no return
  518. * value.
  519.  
  520. * Filesystem clients need to clear xc_RecogSize and xc_RecogData. The
  521. * recognition is automatically done by GetInfo. XADERR_FILESYSTEM is
  522. * returned in case of unknown format. If it is known detection should
  523. * go on and any other code may be returned, if it fails.
  524. * The field xc_ArchiverName means xc_FileSystemName for filesystem
  525. * clients.
  526.  
  527. XADCLIENT_VERSION    EQU    1
  528.  
  529.     BITDEF XADC,FILEARCHIVER,0    * archiver is a file archiver
  530.     BITDEF XADC,DISKARCHIVER,1    * archiver is a disk archiver
  531.     BITDEF XADC,EXTERN,2        * external client, set by xadmaster
  532.     BITDEF XADC,FILESYSTEM,3    * filesystem clients (V5)
  533.     BITDEF XADC,NOCHECKSIZE,4    * do not check size for recog call (V6)
  534.     BITDEF XADC,FREESKIPINFO,27    * master frees xadSkipInfo structures (V3)
  535.     BITDEF XADC,FREETEXTINFO,28    * master frees xadTextInfo structures (V2)
  536.     BITDEF XADC,FREETEXTINFOTEXT,29    * master frees xadTextInfo text block (V2)
  537.     BITDEF XADC,FREEFILEINFO,30    * master frees xadFileInfo structures (V2)
  538.     BITDEF XADC,FREEDISKINFO,31    * master frees xadDiskInfo structures (V2)
  539.  
  540. *************************************************************************
  541. *                                                *
  542. *    client ID's                                   *
  543. *                                                *
  544. *************************************************************************
  545.  
  546. * If an external client has set the xc_Identifier field, the internal
  547. * client is replaced.
  548.  
  549. * disk archivers start with 1000
  550. XADCID_XMASH            EQU    1000
  551. XADCID_SUPERDUPER3        EQU    1001
  552. XADCID_XDISK            EQU    1002
  553. XADCID_PACKDEV            EQU    1003
  554. XADCID_ZOOM            EQU    1004
  555. XADCID_ZOOM5            EQU    1005
  556. XADCID_CRUNCHDISK        EQU    1006
  557. XADCID_PACKDISK            EQU    1007
  558. XADCID_MDC            EQU    1008
  559. XADCID_COMPDISK            EQU    1009
  560. XADCID_LHWARP            EQU    1010
  561. XADCID_SAVAGECOMPRESSOR        EQU    1011
  562.  
  563. * file archivers start with 5000
  564. XADCID_TAR            EQU    5000
  565. XADCID_SDSSFX            EQU    5001
  566. XADCID_LZX            EQU    5002
  567. XADCID_MXMSIMPLEARC        EQU    5003
  568. XADCID_LHPAK            EQU    5004
  569. XADCID_AMIGAPLUSUNPACK        EQU    5005
  570. XADCID_AMIPACK            EQU    5006
  571. XADCID_LHA            EQU    5007
  572. XADCID_LHASFX            EQU    5008
  573. XADCID_PCOMPARC            EQU    5009
  574. XADCID_SOMNI            EQU    5010
  575. XADCID_LHSFX            EQU    5011
  576. XADCID_XPKARCHIVE        EQU    5012
  577. XADCID_SHRINK            EQU    5013
  578. XADCID_SPACK            EQU    5014
  579. XADCID_SPACKSFX            EQU    5015
  580. XADCID_ZIP            EQU    5016
  581. XADCID_WINZIPEXE        EQU    5017
  582. XADCID_GZIP            EQU    5018
  583. XADCID_ARC            EQU    5019
  584. XADCID_ZOO            EQU    5020
  585. XADCID_LHAEXE            EQU    5021
  586. XADCID_ARJ            EQU    5022
  587. XADCID_ARJEXE            EQU    5023
  588. XADCID_ZIPEXE            EQU    5024
  589. XADCID_LHF            EQU    5025
  590. XADCID_COMPRESS            EQU    5026
  591. XADCID_ACE            EQU    5027
  592. XADCID_ACEEXE            EQU    5028
  593.  
  594. * filesystem client start with 8000
  595. XADCID_FSAMIGA            EQU    8000
  596. XADCID_FSSANITYOS        EQU    8001
  597. XADCID_FSFAT            EQU    8002
  598.  
  599. * mixed archivers start with 9000
  600. XADCID_DMS            EQU    9000
  601. XADCID_DMSSFX            EQU    9001
  602.  
  603.     ENDC    ; LIBRARIES_XADMASTER_I
  604.